package com.ruoyi.system.service.impl;

import java.util.List;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.system.mapper.ShoppingcartMapper;
import com.ruoyi.system.domain.Shoppingcart;
import com.ruoyi.system.service.IShoppingcartService;

/**
 * 购物车Service业务层处理
 * 
 * @author ruoyi
 * @date 2023-12-04
 */
@Service
public class ShoppingcartServiceImpl implements IShoppingcartService 
{
    @Autowired
    private ShoppingcartMapper shoppingcartMapper;

    /**
     * 查询购物车
     * 
     * @param shopId 购物车主键
     * @return 购物车
     */
    @Override
    public Shoppingcart selectShoppingcartByShopId(Long shopId)
    {
        return shoppingcartMapper.selectShoppingcartByShopId(shopId);
    }

    /**
     * 查询购物车列表
     * 
     * @param shoppingcart 购物车
     * @return 购物车
     */
    @Override
    public List<Shoppingcart> selectShoppingcartList(Shoppingcart shoppingcart)
    {
        return shoppingcartMapper.selectShoppingcartList(shoppingcart);
    }

    /**
     * 新增购物车
     * 
     * @param shoppingcart 购物车
     * @return 结果
     */
    @Override
    public int insertShoppingcart(Shoppingcart shoppingcart)
    {
        return shoppingcartMapper.insertShoppingcart(shoppingcart);
    }

    /**
     * 修改购物车
     * 
     * @param shoppingcart 购物车
     * @return 结果
     */
    @Override
    public int updateShoppingcart(Shoppingcart shoppingcart)
    {
        return shoppingcartMapper.updateShoppingcart(shoppingcart);
    }

    /**
     * 批量删除购物车
     * 
     * @param shopIds 需要删除的购物车主键
     * @return 结果
     */
    @Override
    public int deleteShoppingcartByShopIds(Long[] shopIds)
    {
        return shoppingcartMapper.deleteShoppingcartByShopIds(shopIds);
    }

    /**
     * 删除购物车信息
     * 
     * @param shopId 购物车主键
     * @return 结果
     */
    @Override
    public int deleteShoppingcartByShopId(Long shopId)
    {
        return shoppingcartMapper.deleteShoppingcartByShopId(shopId);
    }
}
